package com.ywj.boot_security.mapper;

import com.ywj.boot_security.entity.Role;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface RoleMapper {

    /**
     * 查询用户角色
     * @param id
     * @return
     */
    @Select({
            "SELECT b.id,b.role" ,
            "FROM user_role a,role b" ,
            "WHERE a.role_id = b.id and a.user_id = #{id}"
    })
    List<Role> findRolesByUserId(Integer id);
}

